package cn.formaggie.service.impl;

import cn.formaggie.dao.SampleDao;
import cn.formaggie.entity.model.sample.Sample;
import cn.formaggie.service.face.SampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("sampleService")
public class SampleServiceImpl implements SampleService {

    @Autowired
    private SampleDao sampleDao;

    @Override
    public List<Sample> getAllSamples() {
        return sampleDao.getAllSamples();
    }

    @Override
    public List<Sample> findSamples(Map<String, Object> map) {
        return sampleDao.findSamples(map);
    }

    @Override
    public Integer getSamplesCount(Map<String, Object> map) {
        return sampleDao.getSamplesCount(map);
    }

    @Override
    public Boolean addSample(Sample sample) {
        return sampleDao.addSample(sample)>0?true:false;
    }

    @Override
    public Boolean modifyInfo(Sample sample) {
        return sampleDao.modifyInfo(sample)>0?true:false;
    }

    @Override
    public Boolean deleteSample(Integer id) {
        return sampleDao.deleteSample(id)>0?true:false;
    }
}
